# -*- encoding : utf-8 -*-
# This file should contain all the record creation needed to seed the database with its default values.
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
#
# Examples:
#
#   cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
#   Mayor.create(name: 'Emanuel', city: cities.first)
User.delete_all
Role.delete_all
Faculty.delete_all
Book.delete_all
BookCategory.delete_all
Role.create(
:role_name => 'Student'
)
Role.create(
:role_name => 'Teacher'
)
Role.create(
:role_name => 'Admin'
)




Faculty.create(
:faculty_name => 'Điện điện tử'
)
Faculty.create(
:faculty_name => 'Cơ khí'
)
Faculty.create(
:faculty_name => 'Xây dựng'
)
Faculty.create(
:faculty_name => 'Công nghệ hóa học'
)

User.create(
:username =>'minhtucs',
:password => '123456',
:password_confirmation => '123456',
:email  => 'minhtu@gmail.com',
:fullname => 'nguyen minh tu',
:card_id => 1,
:phone => '19001570',
:reader_id => 1,
:faculty_id => 1,
:role_id => 3)

User.create(
:username =>'quocvinhcs',
:password => '123456',
:password_confirmation => '123456',
:email  => 'quocvinh@gmail.com',
:fullname => 'huaquocvinh',
:card_id => 1,
:phone => '19001570',
:reader_id => 1,
:faculty_id => 1,
:role_id => 1)

BookCategory.create(
:category_name => 'Computers & Technology'
)
BookCategory.create(
:category_name => 'Education & Reference'
)
BookCategory.create(
:category_name => 'Humor & Entertainment'
)
BookCategory.create(
:category_name => 'Politics & Social Sciences'
)
BookCategory.create(
:category_name => 'Professional & Technical'
)

Book.create(
:title => 'Programming for the Absolute Beginner',
:author => 'Jerry Lee Ford Jr',
:publisher => 'Firebrand Books',
:price => 500000,
:quantity => 5,
:book_category_id => 1,
:image_url => 'books/1.jpg',
:free_quantity => 1,
:description => 'Want to learn computer programminming for the Absolute Beginner provides a gentle learning curve in programming for anyone who wants to develop fundamental programming skills and create computer programs. The primary focus is on teaching the reader how to program using a free implementation of BASIC called Just BASIC. As such, the book focuses on developing programs that run on Microsoft Windows, but also presents programming principles that apply to different environments, including other operating systems and the Internet. Additionally, the book provides a solid foundation for advancing to different programming languages as you gain confidence in your newly acquired programming abilities. As part of the for the absolute beginner series, Programming for the Absolute Beginner teaches all the concepts through the creation of simple computer games, making the learning process much more fun and enjoyable.'
)


